import * as TYPES from '@/store/action-types.js'
import {queryStoreList} from "@/api/index.js";
export const storeAction = {
    async queryStoreListAsync(){
        let list = null;
        try{
            const {code, data} = await queryStoreList()
            if(code === '200'){
                list = data
            }
        }catch (e) {
            list = null
        }
        return {
            type: TYPES.STORE_LIST,
            list
        }
    },
    clearStoreList(){
        return {
            type: TYPES.STORE_LIST,
            list: null
        }
    },
    delStoreById(id){
        return {
            type: TYPES.STORE_REMOVE,
            id
        }
    },
}